package org.xdq.demo.url.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.xdq.demo.url.model.UrlInfo;

import java.util.List;

@Mapper
public interface UrlDao {

    @Insert("insert into t_url(url_src,url_short) values(#{url_src},#{url_short})")
    void insertUrl(UrlInfo urlInfo);

    @Select("select url_src from t_url where url_short = #{url}")
    String getUrlSrc(String url);

    @Select("select * from t_url")
    List<UrlInfo> getUrlList();
}
